<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        // 属性私有化
        function Per(name,gender) {
            //利用Symbol 实现属性私有化，造成无法访问到这个属性
            let _gender = Symbol('gender')
            this.name = name;
            this[_gender] = gender;
        }
        Per.prototype.say = function () {

            console.log(this[_gender]);
        }
        let person = new Per("wwmm",'男');
        person.say();
    </script>
</body>
</html>